import { _decorator, Component, Node, tween, Vec3 } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('CannonBullet')
export class CannonBullet extends Component {
    start() {

    }

    onFireBullet(pos:Vec3 , par:Node) {
        tween(this.node)
            .to(0.5, { position: pos }, { easing: 'sineIn' })
            .call(() => {
                this.node.setParent(par);
                this.node.setPosition(Vec3.ZERO)

                //this.onFrieBullet(3);

                this.scheduleOnce(() => { this.node.removeFromParent() }, 0.7)
            })
            .start();
    }
}


